from Tkinter import *
import ttk, threading
import Tkinter as tk

class Progress(tk.Frame):
    def __init__(self, parent):
        self.progressbar = ttk.Progressbar(parent, orient = HORIZONTAL, mode = 'indeterminate')
        self.progressbar.pack()
        self.t = threading.Thread()
        self.t.__init__(target = self.progressbar.start, args = ())
        self.t.start()


    def end(self):
            if self.t.isAlive() == False:
                    self.progressbar.stop()
                    self.t.join()

    def step(self):
        self.progressbar.step(33)